package org.ccay.security.exception;

import org.ccay.core.exception.IHttpCodeProvided;
import org.ccay.core.util.HttpUtil;

/**
 * 认证异常
 * 
 * Created：2011-9-20
 * @author chaowangbang
 * @version:
 */
public class AuthenticationException extends SecuritySystemException implements IHttpCodeProvided {
	
	/**
	 * 用户未登录
	 */
	private static final String ERROR_NOT_LOGIN = "ccay.security.00010002";

	private static final long serialVersionUID = 1243386379964083402L;

	/**
	 * 创建异常
	 */
	public AuthenticationException() {
		super(ERROR_NOT_LOGIN);
	}
	/**
	 * 创建异常
	 * @param errorCode
	 */
	public AuthenticationException(String errorCode) {
		super(errorCode);
	}
	
	/**
	 * 创建异常
	 * @param errorCode
	 * @param args
	 */
	public AuthenticationException(String errorCode, Object... args) {
		super(errorCode, args);
	}

	/**
	 * 创建异常
	 * @param e
	 */
	public AuthenticationException(Throwable e) {
		super(ERROR_NOT_LOGIN, e);
	}
	/* (non-Javadoc)
	 * @see www.ccay.org.ccay.core.exception.IHttpCodeProvided#getHttpCode()
	 */
	public int getHttpCode() {
		return HttpUtil.NOT_LOGIN;
	}
	
}
